home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / Source / Foundation / OS / ZBootStrap.h < prev    next >
Text File  |  1997-02-20  |  2KB  |  78 lines

  1. /*
  2.  *  File:       ZBootStrap.h
  3.  *  Summary:       An object used to initialize and terminate an application.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->    10/27/96    JDJ        Created (from ZAppBootStrap)
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include <string>
  17.  
  18.  
  19. //-----------------------------------
  20. //    Forward References
  21. //
  22. template<class TYPE, class ALLOCATOR> class list;
  23.  
  24.  
  25. // ===================================================================================
  26. //    class TBootStrap
  27. //        If you're writing a full fledged application you'll probably want to use
  28. //        TAppBootStrap.
  29. // ===================================================================================
  30. class TBootStrap {
  31.  
  32. //-----------------------------------
  33. //    Initialization/Destruction
  34. //
  35. public:
  36.     virtual             ~TBootStrap();
  37.     
  38.                           TBootStrap();
  39.  
  40. //-----------------------------------
  41. //    New API
  42. //
  43. public:
  44.     virtual void         Boot();
  45.     
  46.     static    bool         Running();
  47.                         // Returns true after the system has been initialized and before
  48.                         // static objects start getting destroyed.
  49.                         
  50.     static    bool         Exiting();
  51.                         // Returns true if the program is exiting normally.
  52.                         
  53.     static void         DoEarlyInit();
  54.                         // This is called before static objects are constructed and needs
  55.                         // to be defined this in Main.cpp. You should use it to call MoreMasters
  56.                         // and to create the object heap.
  57.     
  58. protected:
  59.     virtual void         HandleSystemCheck();
  60.                         // Calls OnSystemNeeds to construct a list of reasons the app
  61.                         // can't run. If the list isn't empty an alert is displayed and
  62.                         // ExitToShell is called.
  63.                         
  64.     virtual void         OnSystemNeeds(list<string, allocator<string> >& needs);
  65.                         // Override and return strings indicating why the user can't run
  66.                         // the app. For example, if the user needs the Drag Manager and
  67.                         // QuickTime add 'the Drag Manager' and 'QuickTime' to the list.
  68.     
  69.     virtual void         OnBoot()                                {}
  70.                 
  71. //-----------------------------------
  72. //    Member data
  73. //
  74. private:
  75.     static     bool    msRunning;
  76.     static    bool    msExiting;
  77. };
  78.